package com.hema.auction.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * author by john
 */

public class GoodsInfo implements Parcelable {

    private String name; //名称
    @SerializedName("price")
    private String price;//价格
    @SerializedName("status")
    private int status; //状态
    @SerializedName("img")
    private String img;//图片
    private String save;//节省
    private String date;//日期
    private String useShoppingCoin;//使用购物币
    private int did;//出价次数
    private boolean isTenZone;
    @SerializedName("g_time")
    private String gTime;
    @SerializedName("id")
    private String id;
    @SerializedName("good_name")
    private String goodName;
    @SerializedName("category_id")
    private String categoryId;
    @SerializedName("auction")
    private String auction;
    @SerializedName("remark")
    private String remark;
    @SerializedName("a_price")
    private String aPrice;
    @SerializedName("owner_name")
    private String ownerName;
    @SerializedName("now_price")
    private float nowPrice;
    @SerializedName("is_on_sale")
    private int isOnSale;//是否在竞拍中，1是  2否
    @SerializedName("is_collected")
    private int isCollected;//1已收藏，0未收藏
    @SerializedName("final_time")
    private String finalTime;
    @SerializedName("final_price")
    private String finalPrice;
    @SerializedName("tol_buytime")
    private int tolBuytime;
    @SerializedName("new_good_id")
    private String newGoodId = "null";
    @SerializedName("start_price")
    private String startPrice;
    @SerializedName("service_price")
    private String servicePrice;
    @SerializedName("is_dif_buy")
    private int isDifBuy;
    @SerializedName("up_range")
    private String upRange;
    @SerializedName("back_rate")
    private String backRate;
    @SerializedName("order_count")
    private String orderCount;
    @SerializedName("uid")
    private String uid;
    @SerializedName("gw_price")
    private float gwPrice;
    @SerializedName("countdown")
    private int countdown;

    @SerializedName("type")
    private int type;
    @SerializedName("user_name")
    private String userName;
    @SerializedName("auction_time")
    private int auctionTime;
    @SerializedName("good_pic")
    private String goodPic;
    @SerializedName("consignee")
    private String consignee;
    @SerializedName("c_phone")
    private String cPhone;
    @SerializedName("address")
    private String address;
    @SerializedName("back_price")
    private double backPrice;
    @SerializedName("order_id")
    private String orderId;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getSave() {
        float dealPrice = Float.valueOf(finalPrice);
        float marktPrice = Float.valueOf(price);
        save = String.valueOf(100 - dealPrice / marktPrice * 100);
        return save;
    }

    public void setSave(String save) {
        this.save = save;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public int getIsCollected() {
        return isCollected;
    }

    public void setIsCollected(int isCollected) {
        this.isCollected = isCollected;
    }

    public String getUseShoppingCoin() {
        return useShoppingCoin;
    }

    public void setUseShoppingCoin(String useShoppingCoin) {
        this.useShoppingCoin = useShoppingCoin;
    }

    public int getDid() {
        return did;
    }

    public void setDid(int did) {
        this.did = did;
    }

    public boolean isTenZone() {
        return isTenZone;
    }

    public void setTenZone(boolean tenZone) {
        isTenZone = tenZone;
    }

    public String getGTime() {
        return gTime;
    }

    public void setGTime(String gTime) {
        this.gTime = gTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getGoodName() {
        return goodName;
    }

    public void setGoodName(String goodName) {
        this.goodName = goodName;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getAuction() {
        return auction;
    }

    public void setAuction(String auction) {
        this.auction = auction;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getAPrice() {
        return aPrice;
    }

    public void setAPrice(String aPrice) {
        this.aPrice = aPrice;
    }

    public String getOwnerName() {
        return ownerName;
    }

    public void setOwnerName(String ownerName) {
        this.ownerName = ownerName;
    }

    public float getNowPrice() {
        return nowPrice;
    }

    public void setNowPrice(float nowPrice) {
        this.nowPrice = nowPrice;
    }

    public int getIsOnSale() {
        return isOnSale;
    }

    public void setIsOnSale(int isOnSale) {
        this.isOnSale = isOnSale;
    }

    public int getTolBuytime() {
        return tolBuytime;
    }

    public void setTolBuytime(int tolBuytime) {
        this.tolBuytime = tolBuytime;
    }

    public GoodsInfo() {
    }

    public String getFinalTime() {
        return finalTime;
    }

    public void setFinalTime(String finalTime) {
        this.finalTime = finalTime;
    }

    public String getFinalPrice() {
        return finalPrice;
    }

    public void setFinalPrice(String finalPrice) {
        this.finalPrice = finalPrice;
    }

    public String getNewGoodId() {
        return newGoodId;
    }

    public void setNewGoodId(String newGoodId) {
        this.newGoodId = newGoodId;
    }

    public String getgTime() {
        return gTime;
    }

    public void setgTime(String gTime) {
        this.gTime = gTime;
    }

    public String getStartPrice() {
        return startPrice;
    }

    public void setStartPrice(String startPrice) {
        this.startPrice = startPrice;
    }

    public String getServicePrice() {
        return servicePrice;
    }

    public void setServicePrice(String servicePrice) {
        this.servicePrice = servicePrice;
    }

    public int getIsDifBuy() {
        return isDifBuy;
    }

    public void setIsDifBuy(int isDifBuy) {
        this.isDifBuy = isDifBuy;
    }

    public String getUpRange() {
        return upRange;
    }

    public void setUpRange(String upRange) {
        this.upRange = upRange;
    }

    public String getBackRate() {
        return backRate;
    }

    public void setBackRate(String backRate) {
        this.backRate = backRate;
    }

    public String getOrderCount() {
        return orderCount;
    }

    public void setOrderCount(String orderCount) {
        this.orderCount = orderCount;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public float getGwPrice() {
        return gwPrice;
    }

    public void setGwPrice(float gwPrice) {
        this.gwPrice = gwPrice;
    }

    public int getCountdown() {
        return countdown;
    }

    public void setCountdown(int countdown) {
        this.countdown = countdown;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getAuctionTime() {
        return auctionTime;
    }

    public void setAuctionTime(int auctionTime) {
        this.auctionTime = auctionTime;
    }

    public String getGoodPic() {
        return goodPic;
    }

    public void setGoodPic(String goodPic) {
        this.goodPic = goodPic;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public String getcPhone() {
        return cPhone;
    }

    public void setcPhone(String cPhone) {
        this.cPhone = cPhone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public double getBackPrice() {
        return backPrice;
    }

    public void setBackPrice(double backPrice) {
        this.backPrice = backPrice;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeString(this.price);
        dest.writeInt(this.status);
        dest.writeString(this.img);
        dest.writeString(this.save);
        dest.writeString(this.date);
        dest.writeString(this.useShoppingCoin);
        dest.writeInt(this.did);
        dest.writeByte(this.isTenZone ? (byte) 1 : (byte) 0);
        dest.writeString(this.gTime);
        dest.writeString(this.id);
        dest.writeString(this.goodName);
        dest.writeString(this.categoryId);
        dest.writeString(this.auction);
        dest.writeString(this.remark);
        dest.writeString(this.aPrice);
        dest.writeString(this.ownerName);
        dest.writeFloat(this.nowPrice);
        dest.writeInt(this.isOnSale);
        dest.writeInt(this.isCollected);
        dest.writeString(this.finalTime);
        dest.writeString(this.finalPrice);
        dest.writeInt(this.tolBuytime);
        dest.writeString(this.newGoodId);
        dest.writeString(this.startPrice);
        dest.writeString(this.servicePrice);
        dest.writeInt(this.isDifBuy);
        dest.writeString(this.upRange);
        dest.writeString(this.backRate);
        dest.writeString(this.orderCount);
        dest.writeString(this.uid);
        dest.writeFloat(this.gwPrice);
        dest.writeInt(this.countdown);
        dest.writeInt(this.type);
        dest.writeString(this.userName);
        dest.writeInt(this.auctionTime);
        dest.writeString(this.goodPic);
        dest.writeString(this.consignee);
        dest.writeString(this.cPhone);
        dest.writeString(this.address);
        dest.writeDouble(this.backPrice);
        dest.writeString(this.orderId);
    }

    protected GoodsInfo(Parcel in) {
        this.name = in.readString();
        this.price = in.readString();
        this.status = in.readInt();
        this.img = in.readString();
        this.save = in.readString();
        this.date = in.readString();
        this.useShoppingCoin = in.readString();
        this.did = in.readInt();
        this.isTenZone = in.readByte() != 0;
        this.gTime = in.readString();
        this.id = in.readString();
        this.goodName = in.readString();
        this.categoryId = in.readString();
        this.auction = in.readString();
        this.remark = in.readString();
        this.aPrice = in.readString();
        this.ownerName = in.readString();
        this.nowPrice = in.readFloat();
        this.isOnSale = in.readInt();
        this.isCollected = in.readInt();
        this.finalTime = in.readString();
        this.finalPrice = in.readString();
        this.tolBuytime = in.readInt();
        this.newGoodId = in.readString();
        this.startPrice = in.readString();
        this.servicePrice = in.readString();
        this.isDifBuy = in.readInt();
        this.upRange = in.readString();
        this.backRate = in.readString();
        this.orderCount = in.readString();
        this.uid = in.readString();
        this.gwPrice = in.readFloat();
        this.countdown = in.readInt();
        this.type = in.readInt();
        this.userName = in.readString();
        this.auctionTime = in.readInt();
        this.goodPic = in.readString();
        this.consignee = in.readString();
        this.cPhone = in.readString();
        this.address = in.readString();
        this.backPrice = in.readDouble();
        this.orderId = in.readString();
    }

    public static final Creator<GoodsInfo> CREATOR = new Creator<GoodsInfo>() {
        @Override
        public GoodsInfo createFromParcel(Parcel source) {
            return new GoodsInfo(source);
        }

        @Override
        public GoodsInfo[] newArray(int size) {
            return new GoodsInfo[size];
        }
    };
}
